<?php
  /**
   * This class provides server specific methods.<br />
   *
   * @version 1.0 beta
   * @author Dany Mottier
   *
   * @see <a href="http://fr2.php.net/manual/en/book.nsapi.php">online documentation</a>
   */
  abstract class NSAPI {
    /**
     * Fetch all HTTP request headers.<br />
     * Gets all the HTTP headers in the current request.<br />
     * This is only supported when PHP runs as a NSAPI module.<br />
     *
     * @return array Returns an associative array with all the HTTP headers.<br /><br />
     *
     * @see <a href="http://fr2.php.net/manual/en/function.nsapi-request-headers.php">nsapi_request_headers()</a>
     */
    public function FetchRequestHeaders() {
      return nsapi_request_headers();
    }

    /**
     * Fetch all HTTP response headers.<br />
     * Gets all the NSAPI response headers.<br />
     *
     * @return array Returns an associative array with all the NSAPI response headers.<br /><br />
     *
     * @see <a href="http://fr2.php.net/manual/en/function.nsapi-response-headers.php">nsapi_response_headers()</a>
     */
    public function FetchResponseHeaders() {
      return nsapi_response_headers();
    }

    /**
     * Perform an NSAPI sub-request.<br />
     * It is an NSAPI-specific function which is equivalent to
     * <!--#include virtual...--> in SSI (.shtml files).<br />
     * It does an NSAPI sub-request.<br />
     * It is useful for including CGI scripts or .shtml files, or anything else
     * that you'd parse through webserver.<br />
     * To run the sub-request, all buffers are terminated and flushed to the
     * browser, pending headers are sent too.<br />
     * You cannot make recursive requests with this function to other PHP scripts.<br />
     * If you want to include PHP scripts, use include() or require().<br />
     *
     * @param string $uri The URI of the script.
     *
     * @return boolean Returns TRUE on success or FALSE on failure.<br /><br />
     *
     * @see <a href="http://fr2.php.net/manual/en/function.nsapi-virtual.php">nsapi_virtual()</a>
     */
    public function Virtual($uri) {
      return nsapi_virtual($uri);
    }
  }
?>
